package com.smart.stock.module.maindata.services;

import com.smart.stock.module.GlobalConstant;
import com.smart.stock.module.maindata.entity.StockCompany;
import com.smart.stock.module.maindata.entity.StockPriceDaily;
import com.smart.stock.module.spider.jobSpiderWeb.board.BoardIndustrySpider;
import com.smart.stock.module.spider.jobSpiderWeb.board.BoardIndustrySpider2;
import com.smart.stock.module.spider.util.TradingDateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * ${DESCRIPTION}
 *
 * @author chenguoxiang
 * @create 2019-06-11 17:09
 **/
@Slf4j
@Service
public class BoardIndustryService {
    @Autowired
    private TradingDateUtil tradingDateUtil;
    @Autowired
    private MongoTemplate template;
    @Autowired
    private BoardIndustrySpider boardIndustrySpider;
    @Autowired
    private BoardIndustrySpider2 boardIndustrySpider2;

    public void refreshData(String cookieStr){
        if (StringUtils.isNotBlank(cookieStr)) {
            GlobalConstant.URL_THS_INDUSTRY_COOKIESTR = cookieStr;
        }

        boardIndustrySpider.run();
        boardIndustrySpider2.run();
    }



}
